using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Abs.Core.Models.Booking
{
    public class Appointment
    {
        public virtual int AppointmentId { get; set; }
        
        [Required(ErrorMessage = "User Id is required to book a room.")]
        [ForeignKey("User")]
        public string UserEmail { get; set; }
        public User.User User { get; set; }

        [ForeignKey("Room")]
        public int RoomId { get; set; }
        public Room.Room Room { get; set; }

        [Required(ErrorMessage = "The Starting time of using the room is required.")]
        [DataType(DataType.DateTime)]
        public DateTime StartTime { get; set; }

        [Required(ErrorMessage = "The ending time of using the room is required.")]
        [DataType(DataType.DateTime)]
        public DateTime EndTime { get; set; }

        public string Comment { get; set; }
    }//end of public class Appointment
}//end of namespace ABS.Models